package com.twinkle.bank;

/**
 * 储蓄账户
 */
public class SavingAccount extends Account {

    public SavingAccount() {
        super();
    }

    public SavingAccount(String cardNo, String password, int balance) {
        super(cardNo, password, balance);
    }

    /**
     * @param money 取款金额
     * @throws NotEnoughMoneyException 余额不足异常
     */
    public void withdraw(int money) throws NotEnoughMoneyException {
        if (balance < money) {
            throw new NotEnoughMoneyException();
        }
        balance -= money;
    }

}